home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / nan_news / vol2 / no4 / blink.c < prev    next >
Text File  |  1988-05-18  |  2KB  |  88 lines

  1. /* =================== blink.c =================
  2. * 9:34:28  2/17/1988  ldv
  3. * Carson Lee
  4. * Copyright 1988 SourceMate Information System Inc.
  5. * 20 Sunnyside, Mill Valley, Ca 94941
  6. * 415-381-1011
  7. * ============================================== */
  8.  
  9.  
  10. #include "nandef.h"
  11. #include "extend.h"
  12. #include "dos.h"
  13. #define peekb(a) ( * (( unsigned char far * ) ( a ) ))
  14.  
  15.  
  16.  
  17.  
  18.  
  19. /* ------------ blinkoff --------------
  20. * 9:34:47  2/17/1988  ldv
  21. * Carson Lee
  22. * Copyright 1988 SourceMate Information System Inc.
  23. * function to turn on background intensity under Clipper
  24. * there are no calling parameters and no return value
  25. * ------------------------------------ */
  26. CLIPPER blinkoff()
  27. {
  28.  
  29.  union REGS regs;
  30.  unsigned int port;
  31.  
  32.  /* --- take care of ega / vga adapters --- */
  33.  regs.h.ah = 0x10;
  34.  regs.h.al = 3;
  35.  regs.h.bl = 0;
  36.  int86( 0x10, ®s, ®s );
  37.  
  38.  /* --- take care of color / mono adapters --- */
  39.  if ( peekb( 0x449 ) == 7 )    /* check if color or mono */
  40.    port = 0x3b8;               /* mono */
  41.  else
  42.    port = 0x3d8;               /* color */
  43.  
  44.  outp( port, peekb( 0x465 ) & 0xdf );  /* blink off */
  45.  
  46.  _ret();
  47.  
  48. } /* ------ blinkoff.eof.ldv ----- */
  49.  
  50.  
  51.  
  52.  
  53. /* ------------ blinkon -------------
  54. * 9:35:07  2/17/1988  ldv
  55. * Carson Lee
  56. * Copyright 1988 SourceMate Information System Inc.
  57. * function to turn off background intensity under Clipper
  58. * there are no calling parameters and no return value
  59. * ------------------------------------ */
  60. CLIPPER blinkon()
  61. {
  62.  
  63.  union REGS regs;
  64.  unsigned int port;
  65.  
  66.  /* --- take care of ega / vga adapters --- */
  67.  regs.h.ah = 0x10;
  68.  regs.h.al = 3;
  69.  regs.h.bl = 1;
  70.  int86( 0x10, ®s, ®s );
  71.  
  72.  /* --- take care of color / mono adapters --- */
  73.  if ( peekb( 0x449 ) == 7 )    /* check if color or mono */
  74.    port = 0x3b8;               /* mono */
  75.  else
  76.    port = 0x3d8;               /* color */
  77.  
  78.  outp( port, peekb( 0x465 ) | 0x20 );  /* blink on  */
  79.  
  80.  _ret();
  81.  
  82. } /* ------- blinkon.eof.ldv ------ */
  83.  
  84.  
  85.  
  86.  
  87. /* ================ blink.c.eof.ldv ==================== */
  88.